//
// Created by liaohailong on 2025/4/11.
//

#ifndef HELLOVIDEOCACHE_HELLOLOCALFETCHER_HPP
#define HELLOVIDEOCACHE_HELLOLOCALFETCHER_HPP


#include "HelloDataFetcher.hpp"

/**
 * create by liaohailong
 * 2025/4/11 19:38
 * desc: 读取本地数据
 */
class HelloLocalFetcher : public HelloDataFetcher
{
public:
    explicit HelloLocalFetcher(const std::shared_ptr<HelloCacheManager> &cache,
                               const std::shared_ptr<HelloHttpRequest> &request,
                               const std::shared_ptr<HelloRange> &range);

    ~HelloLocalFetcher() override;

    void setCachedRange(const std::shared_ptr<HelloRange> &range);

    bool run(const std::shared_ptr<HelloHttpRequest> &request) override;

protected:
    /**
     * 本地已经缓存好的数据
     */
    std::shared_ptr<HelloRange> cachedRange;
};


#endif //HELLOVIDEOCACHE_HELLOLOCALFETCHER_HPP
